package com.example.microinvestcommon.ai;

import lombok.RequiredArgsConstructor;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.messages.Message;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

@Component
@RequiredArgsConstructor
public class AiMemory implements ChatMemory {


    @Override
    public void add(String conversationId, Message message) {
        ChatMemory.super.add(conversationId, message);
    }

    @Override
    public void add(String conversationId, List<Message> messages) {


    }

    @Override
    public List<Message> get(String conversationId, int lastN) {
        // 返回空列表，避免NPE
        return Collections.emptyList();
    }

    @Override
    public void clear(String conversationId) {

    }
}
